<extend name="Public/base" />

<!-- 子導航 -->
<block name="sidebar">
    <include file="sidemenu" />
</block>

<block name="body">
 
<script type="text/javascript" src="/sf/Public/static/uploadify/jquery.uploadify.min.js"></script>
<script type="text/javascript" src="/sf/Addons/UploadImages/script/UploadImages.js"></script>
<link rel="stylesheet" href="/sf/Addons/UploadImages/style/UploadImages.css">
<style>
 .tags{ margin-bottom: 2px;width:80px; font-size:10px; height: 25px; border-radius: 3px; color:#fff; text-align:center; position:relative; float: left; margin-right: 5px; line-height: 25px}
.shut{ position:absolute; top: 0; right: 2px; font-size:10px;padding-TOP:6px; line-height: 0; font-size: 2px; color: #fff }
.c1{ background:#ec5e5e}
.c2{ background:#5ac991}
.c3{ background:#ff9999}
.shake{ animation:one 0.2s infinite; -webkit-animation:one 0.2s infinite; }
@keyframes one{
	0%{ transform:rotate(10deg);
	-webkit-transform:rotate(10deg);}
	50%{ transform:rotate(-10deg);
	-webkit-transform:rotate(-10deg);}
	100%{ transform:rotate(10deg);-webkit-transform:rotate(10deg);}
	}

@-webkit-keyframes one{
	0%{ transform:rotate(3deg);
	-webkit-transform:rotate(3deg);}
	50%{ transform:rotate(-3deg);
	-webkit-transform:rotate(-3deg);}
	100%{ transform:rotate(4deg);-webkit-transform:rotate(3deg);}
	}
</style> 
	<div class="main-title cf">
		<h2>
			logo設置
		</h2>
	</div>
	<!-- 標簽頁導航 -->
<div class="tab-wrap">
<!--	<ul class="tab-nav nav">
		<volist name=":parse_config_attr($model['field_group'])" id="group">
			<li data-tab="tab{$key}" <eq name="key" value="1">class="current"</eq>><a href="javascript:void(0);">{$group}</a></li>
		</volist>
	</ul>-->
	<div class="tab-content">
	<!-- 表單 -->
	<form id="form" action="{:U('update')}" method="post" class="form-horizontal">
		<!-- 基礎文檔模型 -->
                <input type="text" value="{$data.type}" name="type"  style="display: none">
                      <input type="text" value="{$data.cover_id}" name="cover_id" style="display: none">
                          <input type="text" value="{$data.link_id}" name="link_id" style="display: none"> 

                         
                <div class="form-item cf">
                    <label class="item-label">實景圖<span class="check-tips"></span></label>
                    <div class="controls">

    <div id="upload_picture_photo" class="uploadify" style="height: 30px; width: 120px;"><object id="SWFUpload_1" type="application/x-shockwave-flash" data="/sf/Public/static/uploadify/uploadify.swf?preventswfcaching=1430731466033" width="120" height="30" class="swfupload" style="position: absolute; z-index: 1;"><param name="wmode" value="transparent"><param name="movie" value="/sf/Public/static/uploadify/uploadify.swf?preventswfcaching=1430731466033"><param name="quality" value="high"><param name="menu" value="false"><param name="allowScriptAccess" value="always"><param name="flashvars" value="movieName=SWFUpload_1&amp;uploadURL=%2Fsf%2Findex.php%3Fs%3D%2FAdmin%2FFile%2FuploadPicture%2Fsession_id%2F2pieuumh72k3igkgkiruk66av4.html&amp;useQueryString=false&amp;requeueOnError=false&amp;httpSuccess=&amp;assumeSuccessTimeout=30&amp;params=&amp;filePostName=download&amp;fileTypes=*.jpg%3B%20*.png%3B%20*.gif%3B&amp;fileTypesDescription=All%20Files&amp;fileSizeLimit=0&amp;fileUploadLimit=0&amp;fileQueueLimit=999&amp;debugEnabled=false&amp;buttonImageURL=%2Fsf%2F&amp;buttonWidth=120&amp;buttonHeight=30&amp;buttonText=&amp;buttonTextTopPadding=0&amp;buttonTextLeftPadding=0&amp;buttonTextStyle=color%3A%20%23000000%3B%20font-size%3A%2016pt%3B&amp;buttonAction=-110&amp;buttonDisabled=false&amp;buttonCursor=-2"></object><div id="upload_picture_photo-button" class="uploadify-button " style="height: 30px; line-height: 30px; width: 120px;"><span class="uploadify-button-text">上传图片</span></div></div><div id="upload_picture_photo-queue" class="uploadify-queue"></div>
    <input type="hidden" name="photo" value="{$data['photo']}" class="icon photo">
    <div class="upload-img-box">
       <notempty name="data.photo">
        <volist name='photo' id='vo2'>
        <div class="upload-pre-item">
                    <img src="__ROOT__{:get_cover($vo2,$field = path)}" data-id="{$vo2}">
                    <span class="btn-close btn-close-photo" title="删除图片"></span>
                </div>
        </volist>
                   </notempty>
 
    </div>
                            <script type="text/javascript">
    //上传图片
$(function(){
        /* 初始化上传插件*/
      
        $("#upload_picture_photo").uploadify({
            "height"          : 30,
            "swf"             : "/sf/Public/static/uploadify/uploadify.swf",
            "fileObjName"     : "download",
            "buttonText"      : "上传图片",
            "uploader"        : "/sf/index.php?s=/Admin/File/uploadPicture/session_id/2pieuumh72k3igkgkiruk66av4.html",
            "width"           : 120,
            'removeTimeout'   : 1,
            'fileTypeExts'    : '*.jpg; *.png; *.gif;',
            "onUploadSuccess" : uploadPicturephoto,
            'onFallback' : function() {
                alert('未检测到兼容版本的Flash.');
            }
        });
        $('.btn-close-photo').click(function(event) {
            
            event.preventDefault();
            $(this).parent().remove();
            picsbox = $("#upload_picture_photo").siblings('.upload-img-box');
            picArr = [];
            for (var i = 0; i < picsbox.children().length ; i++) {
                picArr.push(picsbox.children('.upload-pre-item:eq('+i+')').find('img').attr('data-id'));
            };
            picStr = picArr.join(',');
            $('.icon.photo').val(picStr);
        });
})
    function uploadPicturephoto(file, data){
        var data = $.parseJSON(data);
        var src = '';
        if(data.status){
            src = data.url || '/sf' + data.path;
            upload_img = "<div class='upload-pre-item'><img src=" + src +" title='点击显示大图' data-id="+data.id+"> <span class='btn-close btn-close-photo' title='删除图片'></span></div>";
            picsbox = $("#upload_picture_photo").siblings('.upload-img-box');
            picsbox.append(upload_img)
            picArr = [];
            for (var i = 0; i < picsbox.children().length ; i++) {
                picArr.push(picsbox.children('.upload-pre-item:eq('+i+')').find('img').attr('data-id'));
            };
            picStr = picArr.join(',');
            $('.icon.photo').val(picStr);
        } else {
            updateAlert(data.info);
            setTimeout(function(){
                $('#top-alert').find('button').click();
                $(that).removeClass('disabled').prop('disabled',false);
            },1500);
        }
    }
</script>                    </div>
                </div>
               
                <div class="form-item cf">
                    <label class="item-label">外景圖<span class="check-tips"></span></label>
                    <div class="controls">
                        <script type="text/javascript" src="/sf/Public/static/uploadify/jquery.uploadify.min.js"></script>
<script type="text/javascript" src="/sf/Addons/UploadImages/script/UploadImages.js"></script>
<link rel="stylesheet" href="/sf/Addons/UploadImages/style/UploadImages.css">
    <div id="upload_picture_photo2" class="uploadify" style="height: 30px; width: 120px;"><object id="SWFUpload_2" type="application/x-shockwave-flash" data="/sf/Public/static/uploadify/uploadify.swf?preventswfcaching=1430810486915" width="120" height="30" class="swfupload" style="position: absolute; z-index: 1;"><param name="wmode" value="transparent"><param name="movie" value="/sf/Public/static/uploadify/uploadify.swf?preventswfcaching=1430810486915"><param name="quality" value="high"><param name="menu" value="false"><param name="allowScriptAccess" value="always"><param name="flashvars" value="movieName=SWFUpload_2&amp;uploadURL=%2Fsf%2Findex.php%3Fs%3D%2FAdmin%2FFile%2FuploadPicture%2Fsession_id%2F2pieuumh72k3igkgkiruk66av4.html&amp;useQueryString=false&amp;requeueOnError=false&amp;httpSuccess=&amp;assumeSuccessTimeout=30&amp;params=&amp;filePostName=download&amp;fileTypes=*.jpg%3B%20*.png%3B%20*.gif%3B&amp;fileTypesDescription=All%20Files&amp;fileSizeLimit=0&amp;fileUploadLimit=0&amp;fileQueueLimit=999&amp;debugEnabled=false&amp;buttonImageURL=%2Fsf%2F&amp;buttonWidth=120&amp;buttonHeight=30&amp;buttonText=&amp;buttonTextTopPadding=0&amp;buttonTextLeftPadding=0&amp;buttonTextStyle=color%3A%20%23000000%3B%20font-size%3A%2016pt%3B&amp;buttonAction=-110&amp;buttonDisabled=false&amp;buttonCursor=-2"></object><div id="upload_picture_photo2-button" class="uploadify-button " style="height: 30px; line-height: 30px; width: 120px;"><span class="uploadify-button-text">上传图片</span></div></div><div id="upload_picture_photo2-queue" class="uploadify-queue"></div>
    <input type="hidden" name="photo2" value="{$data.photo2}" class="icon photo2">
    <div class="upload-img-box">
     
        <notempty name="data.photo2">
    <volist name='photo2' id='vo'>
         
        <div class="upload-pre-item">
                    <img src="__ROOT__{:get_cover($vo,$field = path)}" data-id="{$vo}">
                    <span class="btn-close btn-close-photo2" title="删除图片"></span>
                </div>
        </volist> 
        </notempty>

          
            </div>
                            <script type="text/javascript">
    //上传图片
$(function(){
        /* 初始化上传插件*/
        $("#upload_picture_photo2").uploadify({
            "height"          : 30,
            "swf"             : "/sf/Public/static/uploadify/uploadify.swf",
            "fileObjName"     : "download",
            "buttonText"      : "上传图片",
            "uploader"        : "/sf/index.php?s=/Admin/File/uploadPicture/session_id/2pieuumh72k3igkgkiruk66av4.html",
            "width"           : 120,
            'removeTimeout'   : 1,
            'fileTypeExts'    : '*.jpg; *.png; *.gif;',
            "onUploadSuccess" : uploadPicturephoto2,
            'onFallback' : function() {
                alert('未检测到兼容版本的Flash.');
            }
        });
        $('.btn-close-photo2').click(function(event) {
            
            event.preventDefault();
            $(this).parent().remove();
            picsbox = $("#upload_picture_photo2").siblings('.upload-img-box');
            picArr = [];
            for (var i = 0; i < picsbox.children().length ; i++) {
                picArr.push(picsbox.children('.upload-pre-item:eq('+i+')').find('img').attr('data-id'));
            };
            picStr = picArr.join(',');
            $('.icon.photo2').val(picStr);
        });
})
    function uploadPicturephoto2(file, data){
        var data = $.parseJSON(data);
        var src = '';
        if(data.status){
            src = data.url || '/sf' + data.path;
            upload_img = "<div class='upload-pre-item'><img src=" + src +" title='点击显示大图' data-id="+data.id+"> <span class='btn-close btn-close-photo2' title='删除图片'></span></div>";
            picsbox = $("#upload_picture_photo2").siblings('.upload-img-box');
            picsbox.append(upload_img)
            picArr = [];
            for (var i = 0; i < picsbox.children().length ; i++) {
                picArr.push(picsbox.children('.upload-pre-item:eq('+i+')').find('img').attr('data-id'));
            };
            picStr = picArr.join(',');
            $('.icon.photo2').val(picStr);
        } else {
            updateAlert(data.info);
            setTimeout(function(){
                $('#top-alert').find('button').click();
                $(that).removeClass('disabled').prop('disabled',false);
            },1500);
        }
    }
</script>                    </div>
                </div>
                  
 </div>

		<div class="form-item cf">
			<button class="btn btn-return" id="submit" type="submit" target-form="form-horizontal">確 定</button>
			<a class="btn btn-return" href="{$Think.cookie.__forward__}">返 回</a>
			<input type="hidden" name="id" value="{$data.id|default=''}"/>
			<input type="hidden" name="pid" value="{$data.pid|default=''}"/>
			<input type="hidden" name="model_id" value="{$data.model_id|default=''}"/>
			<input type="hidden" name="category_id" value="{$data.category_id|default=''}">
		</div>
	</form>
	</div>
</div>

</block>

<block name="script">
<script type="text/javascript">

Think.setValue("type", {$data.type|default='""'});
Think.setValue("display", {$data.display|default=0});

$('#submit').click(function(){
	$('#form').submit();
});
</block>
